﻿package mortal.game.view.friend
{
    import Message.Game.*;
    import com.mui.controls.*;
    import fl.data.*;
    import flash.display.*;
    import mortal.game.view.common.*;

    public class RoleListSpr extends GSprite
    {
        private var _roleList:GTileList;
        private var _closeFriendList:GTileList;
        private var _currentRole:FriendCellRenderer;

        public function RoleListSpr()
        {
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this._roleList = UIFactory.tileList(7, 25 + 21, 300, 315 - 11, this);
            this._roleList.columnWidth = 287;
            this._roleList.rowHeight = 45;
            this._roleList.horizontalGap = 0;
            this._roleList.verticalGap = 0;
            this._roleList.setStyle("skin", new Bitmap());
            this._roleList.setStyle("cellRenderer", FriendCellRenderer);
            this.addChild(this._roleList);
            this._closeFriendList = UIFactory.tileList(7, 25, 300, 315 - 11, this);
            this._closeFriendList.columnWidth = 287;
            this._closeFriendList.rowHeight = 53;
            this._closeFriendList.horizontalGap = 0;
            this._closeFriendList.verticalGap = 0;
            this._closeFriendList.setStyle("skin", new Bitmap());
            this._closeFriendList.setStyle("cellRenderer", FriendCellRenderer);
            this.addChild(this._closeFriendList);
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            this._roleList.dispose(param1);
            this._closeFriendList.dispose(param1);
            this._roleList = null;
            this._closeFriendList = null;
            return;
        }// end function

        public function updateListRoles(param1:Array) : void
        {
            var _loc_3:* = undefined;
            var _loc_4:Object = null;
            var _loc_2:* = new DataProvider();
            for each (_loc_3 in param1)
            {
                
                _loc_4 = new Object();
                _loc_4.data = _loc_3;
                _loc_2.addItem(_loc_4);
            }
            this._roleList.dataProvider = _loc_2;
            this._roleList.drawNow();
            return;
        }// end function

        public function updateCloseFriendList(param1:Array) : void
        {
            var _loc_3:SFriendRecord = null;
            var _loc_4:Object = null;
            var _loc_2:* = new DataProvider();
            for each (_loc_3 in param1)
            {
                
                _loc_4 = new Object();
                _loc_4.data = _loc_3;
                _loc_2.addItem(_loc_4);
            }
            this._closeFriendList.dataProvider = _loc_2;
            this._closeFriendList.drawNow();
            return;
        }// end function

        public function get currentRole() : FriendCellRenderer
        {
            return this._currentRole;
        }// end function

        public function set currentRole(param1:FriendCellRenderer) : void
        {
            this._currentRole = param1;
            return;
        }// end function

        public function get roleList() : GTileList
        {
            return this._roleList;
        }// end function

        public function get closeFriendList() : GTileList
        {
            return this._closeFriendList;
        }// end function

    }
}
